<template>
    <div class="menu-item">
       <!-- 滑动单元格 -->
       <van-swipe-cell>
        <!-- 复选框 -->
        <van-checkbox v-model="item.status" v-if="isEdit"></van-checkbox>
        <van-cell :border="false" :title="item.tel" :value="item.tagName" />
        <template #right>
            <van-button square type="danger" text="删除"  @click="del"/>
            <van-button square type="primary" text="编辑" @click="$router.push(`/about?id=${index}`)"/>
        </template>
        </van-swipe-cell>

    </div>
</template>
<script>
import menuItem from '@/components/menuItem.vue'
import {ref,reactive,toRefs,computed} from 'vue'
import {useRouter} from 'vue-router'
import {useStore} from 'vuex'
export default {
    props:{
        item:Object,
        index:Number,
        isEdit:Boolean
    },
    setup(props) {
        const {commit} = useStore()
       const del = ()=>{
          commit('del',props.index)
       } 
       return {del}
    }
}
</script>
<style lang="scss" scoped>
:deep(.van-swipe-cell__wrapper){
    display: flex;
    padding:0 10px;
}
</style>
